package com.day19.ex10;

import com.day19.ex09.Student;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class ObjectInputStreamDemo {
    public static void main(String[] args) throws IOException,ClassNotFoundException {
        ObjectInputStream ois=new ObjectInputStream(new FileInputStream("myOtherStream\\oos.txt"));
        Object obj=ois.readObject();
        Student s=(Student)obj;
        System.out.println(s.getName()+","+s.getAge());
        ois.close();
    }
}
